﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnglishLibrary;

namespace Helper
{
    public static class VocabularyHelper
    {
        /// <summary>
        /// Get the list of vocabulary which date is from dateBefore to now
        /// </summary>
        /// <param name="list">input list</param>
        /// <param name="dateBefore">the date to compare</param>
        /// <returns>result list which has items' date from dateBefore to now</returns>
        public static List<Vocabulary> RefineTheListByCreatedDate(List<Vocabulary> list, DateTime dateBefore)
        {
            var result = new List<Vocabulary>();
            foreach (var vocabulary in list)
            {
                if (vocabulary.CreatedDate >= dateBefore)
                    result.Add(vocabulary);
            }

            return result;
        }
    }
}
